//
//  CustomCell.m
//  面包旅行_热门游记
//
//  Created by dllo on 15/5/19.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "CustomCell.h"

@implementation CustomCell

/*
 @property (nonatomic, retain) UIImageView *cover_image;
 @property (nonatomic, retain) UIImageView *userImage;
 @property (nonatomic, retain) UIView *symbol;
 @property (nonatomic, retain) UILabel *nameLabel;
 @property (nonatomic, retain) UILabel *start_dayLabel;
 @property (nonatomic, retain) UILabel *day_countLabel;
 @property (nonatomic, retain) UILabel *view_countLabel;
 @property (nonatomic, retain) UILabel *popular_placeLabel;
 @property (nonatomic, retain) UILabel *userNameLabel;
 */

- (void)dealloc
{
    [_cover_image release];
    [_userImage release];
    [_symbol release];
    [_nameLabel release];
    [_start_dayLabel release];
    [_day_countLabel release];
    [_view_countLabel release];
    [_popular_placeLabel release];
    [_userNameLabel release];
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
//        self.contentView.frame = CGRectMake(0, 0, self.frame.size.width, 210);
        [self setSelectionStyle:UITableViewCellSelectionStyleNone];
        [self createCustomCell];
    }
    return self;
}

- (void)createCustomCell
{
    
    CGRect rect = CGRectMake(10, 5, [UIScreen mainScreen].bounds.size.width - 20, [UIScreen mainScreen].bounds.size.height / 3.2);
    self.cover_image = [[UIImageView alloc] init];
    self.cover_image.frame = rect;
//    self.cover_image.backgroundColor = [UIColor orangeColor];
    self.cover_image.layer.cornerRadius = 10;
    [self.cover_image.layer setMasksToBounds:YES];
    [self.contentView addSubview:self.cover_image];

    self.nameLabel = [[UILabel alloc] init];
    self.nameLabel.frame = CGRectMake(10, 15, 300, 35);
    self.nameLabel.font = [UIFont boldSystemFontOfSize:19];
//    self.nameLabel.backgroundColor = [UIColor redColor];
    
//    self.nameLabel.font = [UIFont systemFontOfSize:15];
    [self.cover_image addSubview:self.nameLabel];
    
    self.symbol = [[UIView alloc] init];
    self.symbol.frame = CGRectMake(10, 48, 2, 21);
    [self.cover_image addSubview:self.symbol];
    self.symbol.backgroundColor = [UIColor colorWithRed:119 / 255.0 green:34 / 255.0 blue:13 / 255.0 alpha:1];
    
    self.start_dayLabel = [[UILabel alloc] init];
    self.start_dayLabel.textColor = [UIColor whiteColor];
    self.start_dayLabel.font = [UIFont systemFontOfSize:8];
    self.start_dayLabel.frame = CGRectMake(16, 51, 30, 12);
    self.start_dayLabel.backgroundColor = [UIColor clearColor];
    [self.cover_image addSubview:self.start_dayLabel];
    
    self.day_countLabel = [[UILabel alloc] init];
    self.day_countLabel.textColor = [UIColor whiteColor];
    self.day_countLabel.font = [UIFont systemFontOfSize:8];
    self.day_countLabel.frame = CGRectMake(50, 51, 40, 12);
    self.day_countLabel.backgroundColor = [UIColor clearColor];
    [self.cover_image addSubview:self.day_countLabel];
    
    self.view_countLabel = [[UILabel alloc] init];
    self.view_countLabel.textColor = [UIColor whiteColor];
    self.view_countLabel.font = [UIFont systemFontOfSize:8];
    self.view_countLabel.frame = CGRectMake(110, 51, 100, 12);
    self.view_countLabel.backgroundColor = [UIColor clearColor];
    [self.cover_image addSubview:self.view_countLabel];
    
    
    self.popular_placeLabel = [[UILabel alloc] init];
    self.popular_placeLabel.font = [UIFont systemFontOfSize:8];
    self.popular_placeLabel.frame = CGRectMake(16, 60, 150, 12);
    self.popular_placeLabel.backgroundColor = [UIColor clearColor];
    self.popular_placeLabel.textColor = [UIColor whiteColor];
    [self.cover_image addSubview:self.popular_placeLabel];
    
    self.userImage = [[UIImageView alloc] init];
    self.userImage.frame = CGRectMake(16, 167, 20, 20);
    self.userImage.layer.cornerRadius = 10;
    self.userImage.layer.masksToBounds = YES;
    [self.cover_image addSubview:self.userImage];
//    self.userImage.backgroundColor = [UIColor clearColor];
    
    self.userNameLabel = [[UILabel alloc] init];
    self.userNameLabel.font = [UIFont systemFontOfSize:8];
    self.userNameLabel.frame = CGRectMake(42, 172, 100, 12);
    [self.cover_image addSubview:self.userNameLabel];
    self.userNameLabel.backgroundColor = [UIColor clearColor];
    
    [_cover_image release];
    [_userImage release];
    [_symbol release];
    [_nameLabel release];
    [_start_dayLabel release];
    [_day_countLabel release];
    [_view_countLabel release];
    [_popular_placeLabel release];
    [_userNameLabel release];
  
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
